#include <stdio.h>

int main()
{
    int n;
    scanf("%d",&n);
    int num[15];
    for(int i=1;i<=n;i++)
        scanf("%d",&num[i]);
    //写法一（不推荐）-开头
    //写法一思路：把要插入的位置找出来，然后把后面的东西往后挪动，代码复杂
    /*
    num[0] = -1000000;
    int c;
    scanf("%d",&c);
    int were = n+1;
    for(int i=0;i<=n;i++)
        if(c>=num[i]&&c<=num[i+1])
        {
            were = i+1;
            break;
        }
    for(int i=n+1;i>were;i--) 
        num[i] = num[i-1];
    num[were] = c;
    for(int i=1;i<=n+1;i++) printf("%d ",num[i]);
    */
    //写法一（不推荐）-结束

    //写法二（推荐）-开头
    //写法二思路：把要插入的项放在0位置，然后把num[0]拿来冒泡，冒到一个位置不行了，就break
    for(int i=0;i<n;i++)
    {
        if(num[i] > num[i+1])
        {
            int tmp = num[i];
            num[i] = num[i+1];
            num[i+1] = tmp;
        }
        else
            break;
    }
    for(int i=0;i<=n;i++) printf("%d ",num[i]);
    //写法二（推荐）-结束
    return 0;
}